Imports System.IO
Imports System.Net '.WebClient
Imports System.Text.UnicodeEncoding
Imports System.Threading '.Thread
Public Class Form1

    Private Const URL As String = "http://list.qq.com/cgi-bin/qf_invite?id=ee7b1b8d33cff2adc5d7d26ae32654bd8e5f6a892e64dfa8"

    Private wbc As HttpWebRequest
    Private wbr As HttpWebResponse
    Private wbrs As WebResponse
    Private strm As Stream
    Private sr As StreamReader
    'Private sw As StreamWriter

    Private s As String
    Private blnstop As Boolean = False
    Private t As Thread

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If blnstop Then
            Me.Button1.Text = "start"
            If (t IsNot Nothing) AndAlso t.ThreadState = ThreadState.Running Then t.Abort()
        Else
            Me.Button1.Text = "stop"
            t = New Thread(AddressOf tt)
            t.Start()
        End If

        blnstop = Not blnstop


    End Sub

    Sub tt()
        While blnstop
            wbc = WebRequest.Create(URL)
            s = "to=" & getID() & "@qq.com"
            Dim b() As Byte = ASCII.GetBytes(s)
            Debug.Print(s)
            Dim bb(2048) As Byte
            With wbc
                .Method = "POST"
                .ContentType = "application/x-www-form-urlencoded"
                .ContentLength = b.Length
                strm = .GetRequestStream()
                strm.Write(b, 0, b.Length)
                strm.Close()

                wbr = wbc.GetResponse
                'sr = New StreamReader(.GetResponse, System.Text.Encoding.Default)
                'strm = wbr.GetResponseStream
                sr = New StreamReader(wbr.GetResponseStream, System.Text.Encoding.Default)
                'strm.Read(bb, 0, bb.Length)
                s = sr.ReadToEnd
                sr.Close()
                wbr.Close()
                'Me.TextBox1.Text = strm.Read(bb, 1, bb.Length)
                'strm.Close()

                Me.TextBox1.Text = s
                Debug.Print(s)
            End With 'With wbC
            Thread.Sleep(600000)
        End While ' While blnstop
    End Sub

    Function getID() As Double
        Dim i As Double = 0
        While i < 60000
            Randomize(Now.Ticks)
            i = Fix(CDbl(Rnd() * 9000000000))
        End While
        Return i
    End Function

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Control.CheckForIllegalCrossThreadCalls = False
    End Sub
End Class
